package Thread;

import java.util.Scanner;

public class Demo7 {
    public static void main(String[] args) {
        Thread t = new Thread(() -> {
            Thread cur = Thread.currentThread();
            while(!cur.isInterrupted()){
                System.out.println("hello");
                try {
                    Thread.sleep(100_000);
                } catch (InterruptedException e) {
                    //throw new RuntimeException(e);
                    break;
                }
            }
        });
        t.start();
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        if(n == 0){
            t.interrupt();
        }
    }
}
